<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('礼物管理列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>礼物名称：</label>
                            <input type="text" name="giftName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="marry:goldInfo:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <!--<a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="marry:goldInfo:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="marry:goldInfo:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="marry:goldInfo:export">
                <i class="fa fa-download"></i> 导出
            </a>-->
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
        <div style="font-weight:bold;color: red;">
            注:<br/>
            1.此页为礼物维护,小程序中有金币和送礼物,礼物的种类在这里维护<br>
            2.图片的图片链接直接填,如果是QQ空间的图片,虽然后台显示不可引用,但是图片链接在小程序里可以用<br>
            3.如果是QQ空间的链接,在后台管理系统可能显示未经允许不可引用,不用担心,在小程序里是正常显示的,如果想让照片显示出来,设置一下空间权限和相册权限还有转载权限试试<br>
            4.图片最好为透明背景的png图片,分辨率无所谓,200*200,800*200等等无所谓
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('marry:goldInfo:edit')}]];
    var removeFlag = [[${@permission.hasPermi('marry:goldInfo:remove')}]];
    var prefix = ctx + "marry/goldInfo";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "礼物管理",
            columns: [{
                field: 'no',
                title: '序号',
                align: "center",
                width: 40,
                formatter: function (value, row, index) {
                    //获取每页显示的数量
                    var pageSize = $('#bootstrap-table').bootstrapTable('getOptions').pageSize;
                    //获取当前是第几页
                    var pageNumber = $('#bootstrap-table').bootstrapTable('getOptions').pageNumber;
                    //返回序号，注意index是从0开始的，所以要加上1
                    return pageSize * (pageNumber - 1) + index + 1;
                }
            },
                {
                    field: 'id',
                    title: '主表ID',
                    visible: false
                },
                {
                    field: 'giftName',
                    title: '礼物名称'
                },
                {
                    field: 'giftUrl',
                    title: '礼物图片',
                    formatter: function (value, row, index) {
                        return $.table.imageView(value);
                    }
                },
                {
                    field: 'giftGold',
                    title: '礼物价格'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>